import 'package:xreader/common/dxm_utils.dart';

class AppConfig {
  static const int DB_BATCH_SIZE= 200;
  static const int BSTATUS_DOWN = 0; //已删除
  static const int DEFAULT_PAGE_SIZE = 1000;//默认1000条
  static const int LIST_PAGE_SIZE = 30;//默认分页数 30
  static const int BSTATUS_UP = 1;//未删除
  static const String T_SYS_UPDTAE_SIGN = "update_sign";
  static const String t_book = "t_book";
  static const String t_sys = "t_sys";
  static const String t_book_cont = "t_book_cont";
  static const String BASE = "https://mockapi.eolink.com";
  //配置api,固定不动，返回书籍总数，起停用状态
  static const String CONFIG_API = "https://mockapi.eolink.com/xuGf5dY97a150af53d1f07adc730af366628df1b418cd19/cnb/iot/basic/g1";
  static const String APP_NAME = "dj";//区分App 业务域
  static const String FIXED_PHK = "n8tgEqhe1fc3bd0688cb7560c60c63cf9212baf1b367eea";//固定PHK

  //App 配置接口
  static String bookAppCfgApi(){
    String api = "${BASE}/${FIXED_PHK}/buc/iot/cfg/app/${APP_NAME}";
    return DxmUtils.cleanUrl(api);
  }
  //App book 远程源数据
  static String bookAppLocalPageApi(int page){
    //buc/iot/list/{}/p{}
    String api = "${BASE}/${FIXED_PHK}/buc/iot/list/${APP_NAME}/p${page}";
    return DxmUtils.cleanUrl(api);
  }

  // 获取书籍详情接口 api
  static String bookBkifApi(int bookid,String phk){
    String api = "${BASE}/${phk}/buk/iot/inf/b${bookid}";
    return DxmUtils.cleanUrl(api);
  }

  // 书籍章节详情接口 Api
  static String bookBkciApi(int bookContId,String phk){
    //buc/iot/inf/c{}
    String api = "${BASE}/${phk}/buc/iot/inf/c${bookContId}";
    return DxmUtils.cleanUrl(api);
  }

  // 书籍分页列表-远程
  static String bookPageListApi(int pageIndex){
    String api = "${BASE}/${FIXED_PHK}/buc/iot/sj/list/${AppConfig.APP_NAME}/p${pageIndex}";
    //"buc/iot/sj/list/{}/p{}",app,pageNum
    return DxmUtils.cleanUrl(api);
  }



}

class AppGlobCfg {
  static int? CHAPTER_CACHE_TMSEC;
  static int? CONT_CACHE_TMSEC;

}